package main

func removeTrailingZeros(num string) string {
	pivot := -1
	for i := len(num)-1; i>= 0;i-- {
		c := num[i]
		if c == '0' {
			pivot = i
		} else {
			break
		}
	}
	if pivot == -1 {
		return num
	}
	return num[0:pivot]
}

func main() {
	println(removeTrailingZeros("51230100"))
	println(removeTrailingZeros("512301"))
}